package com.kaishengit.service;

import java.util.ArrayList;
import java.util.List;

import org.apache.taglibs.standard.tag.common.core.ForEachSupport;

import com.kaishengit.dao.MemberDao;
import com.kaishengit.dao.ProjectMemberDao;
import com.kaishengit.entity.Member;
import com.kaishengit.entity.ProjectMember;

public class ProjectMemberService {
	ProjectMemberDao dao = new ProjectMemberDao();
	MemberDao mdao = new MemberDao();
	public List<Member> findMember(){
		String manager = "manager";
		List<ProjectMember> list = dao.findManager(manager);
		List<Member> mlist = new ArrayList<Member>();
		for(ProjectMember pm:list){
			Member member = mdao.findById(pm.getMid());
			mlist.add(member);
		}
		return mlist;
		
		
	}

	public List<Member> findMembers(String pid) {
		
		List<ProjectMember> mids =  dao.findMembers(pid);
		List<Member> list = new ArrayList<Member>();
		for(ProjectMember m:mids){
			Member member = mdao.findById(m.getMid());
			list.add(member);
		}
		return list;
	}

	

	

}
